package com.jiawa.wiki.controller;
import com.jiawa.wiki.resp.CommonResp;
import com.jiawa.wiki.resp.StatisticResp;
import com.jiawa.wiki.service.EbookSnapshotService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

import java.util.List;

/**
 * 这个接口用来获取数值
 */
@RestController
@RequestMapping("/ebook-snapshot")
public class EbookSnapshotController {
    
    @Resource
    private EbookSnapshotService ebookSnapshotService;

    @GetMapping("/get-statistic")
    public CommonResp getStatistic(){
        List<StatisticResp> statisticResp = ebookSnapshotService.getStatistic();
        CommonResp<List<StatisticResp>> commonResp = new CommonResp<>();
        commonResp.setContent(statisticResp);
        return commonResp;
    }
    @GetMapping("/get-30-statistic")
    public CommonResp get30Statistic(){
        List<StatisticResp> statisticResp = ebookSnapshotService.get30Statistic();
        CommonResp<List<StatisticResp>> commonResp = new CommonResp<>();
        commonResp.setContent(statisticResp);
        return commonResp;
    }



}
